package com.v1nsai.dataoff;

import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;

public class Receivers extends Service {
	
	BroadcastReceiver on;
	BroadcastReceiver off;
	
	@Override
	public void onCreate() {
		on = new ScreenOn();
		off = new ScreenOff();
		
		getApplicationContext().registerReceiver(on, new IntentFilter(Intent.ACTION_SCREEN_ON) );
		getApplicationContext().registerReceiver(off, new IntentFilter(Intent.ACTION_SCREEN_OFF) );
	}
	@Override
	public IBinder onBind(Intent intent) {
		// TODO Auto-generated method stub
		return null;
	}

	//@Override
	public void onStop() {
		on = new ScreenOn();
		off = new ScreenOff();
		
		getApplicationContext().unregisterReceiver(on);
		getApplicationContext().unregisterReceiver(off);
	}
}
